<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\GoodOrderDetail
 *
 * @property int $id
 * @property int $oid 订单关联Id
 * @property int $good_id 商品ID
 * @property int $good_number 商品数量
 * @property string $good_price 商品单价
 * @property string $good_name 商品名称
 * @property string|null $good_image 商品图片
 * @property string $total_price 订单总价
 * @property float $shop_rate 门店分成比例
 * @property string $shop_money 门店分成金额
 * @property float $agent_city_rate 市代理商分成比例(有区代理)
 * @property string $agent_city_money 市代理商分成(有区代理)
 * @property float $agent_district_rate 区代理商分成比例
 * @property string $agent_district_money 区代理商分成
 * @property float $agent_city_rate1 市代理商分成比例(无区代理)
 * @property string $agent_city_money1 市代理商分成(无区代理)
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail query()
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereAgentCityMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereAgentCityMoney1($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereAgentCityRate($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereAgentCityRate1($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereAgentDistrictMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereAgentDistrictRate($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereGoodId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereGoodImage($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereGoodName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereGoodNumber($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereGoodPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereOid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereShopMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereShopRate($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereTotalPrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|GoodOrderDetail whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property-read \App\Models\Appraise|null $apprise
 */
class GoodOrderDetail extends Model
{
	use HasDateTimeFormatter;
    protected $table = 'good_order_details';

    protected $fillable = [
        'oid','good_id','good_name','good_image','good_number','good_price','total_price',
        'shop_rate','shop_money','agent_city_rate','agent_city_money','agent_city_rate1'.
        'agent_city_money1','agent_district_rate','agent_district_rate'
    ];

    public function apprise(){
        return $this->hasOne(Appraise::class,"detail_id","id");
    }

}
